package com.demo.es.entity;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单实体
 * @author K
 */
@Accessors(chain = true)
@Data
@Document(indexName = "luna_order")
@Setting(replicas = 0)
public class OrderHeader {

    @Id
    private Long orderId;

    private String orderSn;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String address;

    /**
     * 购买日期
      */
    private Date dateOfPurchase;
    private BigDecimal price;
    /**
     * 固话
      */
    private String tel;
    /**
     * 手机
      */
    private String mobileTel;

    @Field(type = FieldType.Nested)
    private List<OrderDetail> detail;
}
